﻿using System;
using System.Windows;
using Microsoft.Phone.Controls;
using wordroid.Model;
using wordroid.utils;

namespace wordroid.ViewModel.commands {
    public class EditWordCommand : BaseCommand {
        public override void Execute(object parameter) {
            
            PhoneApplicationFrame root = Application.Current.RootVisual as PhoneApplicationFrame;

            if(root != null &&  (parameter as Word).ID != null) {
                root.Navigate(new Uri(String.Format(Constants.EditWordUrl, (parameter as Word).ID), UriKind.Relative));
            }
        }
    }
}
